package com.bawei.property.model

import com.bawei.common.model.BaseRepository
import com.bawei.net.BaseResponse
import com.bawei.net.HttpInterceptorType
import com.bawei.property.api.PropertyApiServer
import com.bawei.property.entity.ColorListResultEntity
import com.bawei.property.entity.ParkApplyResultEntity
import com.bawei.property.entity.ParkListResultEntity
import okhttp3.MultipartBody
import okhttp3.RequestBody
import javax.inject.Inject

/**
 * Author: Jason Zhang
 * Date: 2024/12/20
 * Desc: 车位申请仓库
 * Hilt使用：使用@Inject表示当前对象是可以通过依赖注入的方式，给其他字段赋值
 */
class ParkApplyRepository @Inject constructor(): BaseRepository<PropertyApiServer>() {

    suspend fun getCarApplyList(): ParkListResultEntity = createApiServer(PropertyApiServer::class.java, HttpInterceptorType.TOKEN).getParkingList()
    suspend fun getColorList(): ColorListResultEntity = createApiServer(PropertyApiServer::class.java, HttpInterceptorType.TOKEN).getColorList()
    suspend fun uploadImagesList(list: MutableList<MultipartBody.Part>): BaseResponse = createApiServer(PropertyApiServer::class.java, HttpInterceptorType.UPLOAD).uploadCarImages(list)
    suspend fun getParkApplyList(body: RequestBody): ParkApplyResultEntity = createApiServer(PropertyApiServer::class.java, HttpInterceptorType.TOKEN ).getParkApplyList(body)


}